import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.lang.StringBuffer;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
	    private static Pattern patternImg = Pattern.compile("<img((.+?)src\\s*=\\s*(((\\\"|\\')\\s*([^\\\\3]*?)\\s*(\\\\3))|([^\\s|\\\"|\\'|>]*))[^>]*)>", Pattern.MULTILINE);
	public static String getImg(String page){
	    if(page == null)
	        return null;
	    Matcher matcherA = patternImg.matcher(page);
	    String it = null;
        int index=0;
        StringBuffer sb = new StringBuffer();
        while(true)
        {
	        if(matcherA.find()){
	            it = matcherA.group();
                index = it.indexOf("src=");
                it = it.substring(index+5);
                index = it.indexOf("\"");
                sb.append(it.substring(0,index)).append('\n');
	        }
            else { return sb.toString(); }
        }
	}
    public static void main(String[] args) {
        File output = new File("output.txt");
        File input = new File("test.html");
        Scanner scan = null;
        String res = null;
        try {
            scan = new Scanner(input);
        } catch (FileNotFoundException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
        PrintWriter pwriter = null;
        try {
            pwriter = new PrintWriter(output);
            StringBuffer sb = new StringBuffer();

            while(scan.hasNextLine()){
                sb.append(scan.nextLine());

            }
            res = getImg(sb.toString());
            if(res != null){
                pwriter.print(res+'\n');
            }
        } catch (IOException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
        finally {
            pwriter.close();
        }

    }
}
